@extends('admin_system.layout.layout')

@section('content')
    <style>
        .container {
            width: 100%;
        }

        #nav {
            width: 100%;
            height: 40px;
            background: #E9E9E9;
        }

        #nav div {
            width: 100px;
            height: 40px;
            float: left;
            text-align: center;
            line-height: 40px;
            cursor: pointer;
            background: #F6F6F6;
            border-radius: 3px;
            border: 1px solid #E9E9E9;
            color: black;
        }

        #nav div:nth-child(1) {
            margin-right: 5px;
        }

        #content {
            width: 100%;
            height: auto;
        }
    </style>
    <br>
    <div class="list-group">
        <h4  class="list-group-item active" style="height:50px;line-height:30px;">
            <strong>当前位置:</strong><span>企业帐号管理>></span><span>帐号管理</span>
            <button class="btn btn-default" style="float:right;" onclick="history.back();">返回</button>        
        </h4>
    </div>
    <div class="panel panel-default">
        <div class="panel-body">
            <div id="nav">
                <a href="{{route('account_base_info',['company_code'=>$company->company_sn])}}">
                    <div class="base">
                        基本信息
                    </div>
                </a>

                <a href="{{route('account_son_manage',['company_code'=>$company->company_sn])}}">
                    <div class="son">子账户管理</div>
                </a>
            </div>

            <div id="content">
                @section('content_company')
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <form action="{{route('account_base_info_edit')}}" method="post">
                                {{csrf_field()}}
                                <table class="table table-bordered table-hover">
                                    <tbody>
                                    <tr>
                                        <td>企业名称</td>
                                        <td>
                                            <input type="text" class="form-control" name="company_name" style="width: 30%" readonly value="{{$company->company_name}}">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>企业编号</td>
                                        <td>
                                            <input type="text" class="form-control" name="company_sn" style="width: 30%"
                                                   value="{{$company->company_sn}}" readonly>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>姓名</td>
                                        <td><input type="text" name="manage_name"
                                                   value=""
                                                   class="form-control"
                                                   style="width: 30%"></td>
                                    </tr>
                                    <tr>
                                        <td>手机号</td>
                                        <td><input type="text" name="manage_account" value="" class="form-control" style="width: 30%" autocomplete="off"></td>
                                    </tr>
                                    <tr>
                                        <td>密码</td>
                                        <td>
                                            <input type="password" name="password" class="form-control" style="width: 30%" autocomplete="off">
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>

                                <div style="width: 246px">
                                    <button type="submit" class="btn btn-info" style="width: 100%">保存</button>
                                </div>
                            </form>
                        </div>
                    </div>
                @show
            </div>

        </div>
    </div>


    <script>
        $(function () {
            if (sessionStorage.getItem('status')===null){
                $('.base').css({'background': '#30A4EF'})
                $('.son').css({'background': 'transparent'})
            }else {
                if(sessionStorage.getItem('status')==1){
                    $('.base').css({'background': '#30A4EF'})
                    $('.son').css({'background': 'transparent'})
                }else if(sessionStorage.getItem('status')==2) {
                    $('.son').css({'background': '#30A4EF'})
                    $('.base').css({'background': 'transparent'})
                }
            }
        })
        @if(session('account_errors'))
            sweetAlert("Oops...", "{{session('account_errors')}}!", "error")
        @endif
        @if(session('account_success'))
            sweetAlert("Oops...", "{{session('account_success')}}!", "success")
        @endif

    </script>
@stop